import axios from "axios"

const instance = axios.create({
    baseURL: "https://www.ahsj.link/nebula-api",
    timeout: 5000
})

instance.interceptors.request.use(config => {
    // console.log("config是：" , config);
    let token = localStorage.getItem("token")
    if (token) {
        config.headers["x-auth-token"] = token
    }
    return config
})

instance.interceptors.response.use(res => {
    return res.data
})

export default instance